﻿using System.Drawing;
using System.Windows.Forms;
using Map;
using Map_Creator.MapInfo;

namespace Map_Creator.AutoTileEditor
{
    public partial class AutoTile4Editor : Form
    {
        public AutoTileData TileResult;

        public AutoTile4Editor(TileSet set, AutoTileData tileData)
        {
            InitializeComponent();

            TileSetControl.Initialize(set);

            AutoTiles4Designer.Initialize(tileData, set, TileSetControl, RedoUndoStrip4);
            AutoTilesDpDesigner.Initialize(tileData, set, TileSetControl, RedoUndoStripDp);


            if (tileData != null)
                NavPane.SelectItem((int) tileData.Type);
           
                

            TileSetPanel.Width = set.TilesImage.Width + SystemInformation.VerticalScrollBarWidth;
            TileSetControl.Width = set.TilesImage.Width;
            TileSetControl.Height = set.TilesImage.Height;
            Size = new Size(TileSetPanel.Width +NavPane.MinimumSize.Width + 25,Size.Height);
        }

        private void SaveButton_Click(object sender, System.EventArgs e)
        {
            DialogResult = DialogResult.OK;
            TileResult = AutoTiles4Designer.GetAutoTile();
        }

        private void SaveButtonAutoTileDp_Click(object sender, System.EventArgs e)
        {
            DialogResult = DialogResult.OK;
            TileResult = AutoTilesDpDesigner.GetAutoTile();
        }
    }
}
